package com.tencent.examples.web;

import com.alibaba.fastjson.JSONObject;
import com.tencent.examples.init.AppProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/test")
public class TestController {

    @Autowired
    private AppProperties appConfig;

    @RequestMapping(value = "/index")
    @ResponseBody
    public JSONObject test() {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("status", "ok");
        jsonObject.put("code", appConfig.getJustForDemo());
        return jsonObject;
    }
}
